pub fn convert_base(num_str: &str, to_base: u32) -> String {
    let num_string = num_str.trim().to_string();
    let mut num = Vec::new();
    let mut num_scale = Vec::new();
    let mut j = false;
    for char in num_string.chars(){
        if char != '(' && j==false{
            num.push(char);
        }else if char == '('{
            j = true;

        }else {
            if char != ')'{
                num_scale.push(char);
            }
        }
    }
    let num = num.iter().collect::<String>();
    let num_scale = num_scale.iter().collect::<String>();
    let num_scale = num_scale.parse::<u32>().unwrap();
    let decimal_value = u32::from_str_radix(&num, num_scale).expect("Invalid number for the given scale");
     // 将十进制数字转换为目标进制
    let result = to_base_string(decimal_value, to_base);
    result
}
pub fn to_base_string(mut num: u32, base: u32) -> String {
    let mut result = String::new();
    while num > 0 {
        let digit = num % base;
        result.push(std::char::from_digit(digit, base).unwrap());
        num /= base;
    }
    if result.is_empty() {
        result.push('0');
    }
    result.chars().rev().collect()
}
